<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Андрей
 * Date: 02.05.12
 * Time: 18:49
 * To change this template use File | Settings | File Templates.
 */

    /*
     * Модель Пользователя
     * Все данные о пользователе
     * можно расширять в дальнейшем
     */

    class UserModel
    {
        private $_id;
        private $_login;

        private $_name;
        private $_surname = null;
        private $_photo = null;
        private $_backImage = null;
        private $_passwordHash = null;
        private $_motto = null;
        private $_karma = null;

        private $_password;

        public function __construct($id = null,$login = null,$name = null)
        {
            $this->_id = $id;
            $this->_login = $login;
            $this->_name = $name;
        }

        public function setId($id)
        {
            $this->_id = $id;
            return $this;
        }

        public function getId()
        {
            return $this->_id;
        }

        public function setLogin($login)
        {
            $this->_login = $login;
            return $this;
        }

        public function getLogin()
        {
            return $this->_login;
        }

        public function setName($name)
        {
            $this->_name = $name;
            return $this;
        }

        public function getName()
        {
            return $this->_name;
        }

        public function setPasswordHash($passwordHash)
        {
            $this->_passwordHash = $passwordHash;
            return $this;
        }

        public function getPasswordHash()
        {
            return $this->_passwordHash;
        }

        public function setPhoto($photo)
        {
            $this->_photo = $photo;
            return $this;
        }

        public function getPhoto()
        {
            return $this->_photo;
        }

        public function setSurname($surname)
        {
            $this->_surname = $surname;
            return $this;
        }

        public function getSurname()
        {
            return $this->_surname;
        }

        public function setKarma($karma)
        {
            $this->_karma = $karma;
            return $this;
        }

        public function getKarma()
        {
            return $this->_karma;
        }

        public function setMotto($motto)
        {
            $this->_motto = $motto;
            return $this;
        }

        public function getMotto()
        {
            return $this->_motto;
        }

        public function setBackImage($backImage)
        {
            $this->_backImage = $backImage;
            return $this;
        }

        public function getBackImage()
        {
            return $this->_backImage;
        }

        public function isAuthorized()
        {
           return $this->_id == null ? false : true;
        }

        public function setPassword($password)
        {
            $this->_password = $password;
            return $this;
        }

        public function getPassword()
        {
            return $this->_password;
        }

    }
